package iso3.pt.action;

import java.util.ArrayList;
import java.util.List;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Preparable;

import iso3.pt.model.Alumno;
import iso3.pt.model.Asignatura;
import iso3.pt.model.Evaluacion;
import iso3.pt.model.Unidad;
import iso3.pt.service.PtDaoService;

public class SubjectMarkingAction extends ActionSupport implements Preparable{

	private PtDaoService dao = null;
	private Alumno alu;
	private int aluID;
	private Asignatura asig;
	private int asigID;
	private String concept;
	private float mark;
	
	
	@Override
	public void prepare() throws Exception {
		if (dao == null){
			dao = new PtDaoService();
		}
		
		alu = dao.getAlumno(aluID);
		asig = dao.getAsignatura(asigID);
	}
	
	public String doMarkForm(){
		return SUCCESS;
	}
	
	public String doSaveMark(){
		dao.addEvaluacion(concept, mark, asigID, aluID);
		return "showStudentSubjectMarks";
	}

	public Alumno getAlu() {
		return alu;
	}

	public void setAlu(Alumno alu) {
		this.alu = alu;
	}

	public Asignatura getAsig() {
		return asig;
	}

	public void setAsig(Asignatura asig) {
		this.asig = asig;
	}

	public int getAsigID() {
		return asigID;
	}

	public void setAsigID(int asigID) {
		this.asigID = asigID;
	}

	public int getAluID() {
		return aluID;
	}

	public void setAluID(int aluID) {
		this.aluID = aluID;
	}


	public float getMark() {
		return mark;
	}

	public void setMark(float mark) {
		this.mark = mark;
	}


	public PtDaoService getDao() {
		return dao;
	}

	public void setDao(PtDaoService dao) {
		this.dao = dao;
	}

	public String getConcept() {
		return concept;
	}

	public void setConcept(String concept) {
		this.concept = concept;
	}
	
	
}
